home *** CD-ROM | disk | FTP | other *** search
/ PC Answers 2002 January / PC Answers January 2002.7z / PC Answers January 2002.bin / graphics / freepixl / _SETUP.1 / Y2Kfix.pxl < prev   
Text File  |  2000-12-23  |  4KB  |  147 lines

  1. {    Filename    :     Y2Kfix.pxl
  2.      Purpose    :    This PC has a BIOS that doesn't understand Y2K dates
  3.     Date        :    December 26, 1999
  4.     Author        :    Stewart DIBBS, VYSOR Integration Inc
  5. History:
  6.  
  7.     Version    :  4.20    RELEASE
  8.     Update        :  
  9.     Date        :  
  10.  
  11. --------------------------------------------------------------------------}
  12. Initialize: {only one instance allowed}
  13.     UseCoordinates(PIXEL)
  14.     Title$ = "Correcting the Y2K BIOS bug"                                  
  15.     WinExist(Title$,Res)
  16.     If Res = 0 Then Goto One_Instance
  17.     Beep
  18.     WinSetActive(Title$,Res)
  19.     WinShow(Title$,RESTORE,Res)
  20.     End
  21. One_Instance:
  22.     UseCaption(Title$) {change the title}
  23.     WinLocate(Title$,250,204,830,568,Res)                
  24.     UseBackground(TRANSPARENT,0,128,192)     
  25.     WinShow(Title$,NOTOPMOST,Res) 
  26.     DrawBackGround
  27.     DirGet(SourceDir$) {used later for library function calls}
  28.  
  29.     {DragAcceptFile(ENABLE,AcceptFile)}
  30.     AutoProgressBar(DISABLE)
  31.  
  32.     InfoMenu(REMOVE)
  33.     WaitInput(100)
  34.     SetMenu("&File",IGNORE,
  35.         "E&xit!",Terminate,
  36.         ENDPOPUP,
  37.         "&Information",IGNORE,
  38.         "&Concept",Concept,
  39.         SEPARATOR,
  40.         "&About",About,
  41.         ENDPOPUP)
  42.  
  43.  
  44.     GetLocalTime(Year,Month,DayOfWeek,DayOfMonth,Hour,Minutes)
  45.     Year = 2000
  46.     SetLocalTime(Year,Month,DayOfWeek,DayOfMonth,Hour,Minutes)
  47.  
  48.  
  49.     {GoSub MakeToolbar
  50.     ChangeMenuItem("&ToolBar",CHECK,TBRes) }
  51.  
  52.         
  53.     StatusWindow(ENABLE,BOTTOM,3,300,500,-1,0)
  54.     DrawStatusWinText(0,"Ready")
  55.     GoSub DrawBanner
  56.     ChangeMenuItem("&StatusBar",CHECK,SBRes)
  57.  
  58.         
  59.  
  60.     
  61. Wait_for_Input:
  62.     WaitInput()
  63.  
  64. Terminate:
  65.     End
  66.  
  67.  
  68. Concept:
  69.     MessageBox(OK,1,INFORMATION,
  70. "This is a skeleton of a PiXCL application.  You could briefly
  71. describe your application's function here, or provide some
  72. basic help information.",
  73.     "PiXCL Skeleton Concept",Res)
  74.  
  75.     Goto Wait_for_Input
  76.  
  77. ShowAppHelp:
  78.     {An application Help file usually has the same name as the application.}
  79.     Winhelp("Y2Kfix.hlp",CONTENTS,"")
  80.  
  81.     Goto Wait_for_Input
  82.  
  83. About:
  84.     AboutUser("Correcting the Y2K BIOS bug",  { or substitute Title$}
  85.       "Two lines of text goes here e.g. Application function.",
  86.     "Four Lines of additional information goes here, perhaps contact information and Web addresses")   
  87.  
  88.     Goto Wait_for_Input
  89.  
  90. ViewToolBar:
  91.     GetMenuStatus("&ToolBar",CHECKED,Res)
  92.     If Res = 0
  93.         GoSub MakeToolbar
  94.         ChangeMenuItem("&ToolBar",CHECK,Res)
  95.     Else
  96.         Toolbar()
  97.         ChangeMenuItem("&ToolBar",UNCHECK,Res)
  98.     Endif
  99.     Goto Wait_for_Input
  100.  
  101. ViewStatusBar:
  102.     GetMenuStatus("&StatusBar",CHECKED, Res)
  103.     If Res = 0
  104.         StatusWindow(ENABLE,BOTTOM,3,300,500,-1,0)
  105.         DrawStatusWinText(0,"Ready")
  106.         ChangeMenuItem("&StatusBar",CHECK,Res)
  107.     Else
  108.         StatusWindow(DISABLE,BOTTOM,3,300,500,-1,0)
  109.        ChangeMenuItem("&StatusBar",UNCHECK,Res)
  110.     Endif
  111.     Goto Wait_for_Input
  112.  
  113. CorrectDate:
  114.     SetMouse()
  115.     DrawBackground
  116.  
  117. {
  118.     DirGetWindows(WinDir$)
  119.     DirGetSystem(WinSys$)
  120.     {Loop through the CPL file arguments and see what these applets do}
  121.     Ansi("0",Index)
  122.     Cmd$ = WinDir$ + "\rundll32.exe shell32.dll,Control_RunDLL "
  123.     Cmd$ = Cmd$ + WinSys$ + "\timedate.cpl" + ",@0"
  124.     Run(Cmd$)
  125. }
  126.     End
  127.  
  128.  
  129. {--- Style Suggestion: place all subroutines at the end of the script.}
  130.  
  131. DrawBanner: {subroutine}
  132.     UseFont("Arial",13,27,NOBOLD,NOITALIC,NOUNDERLINE,255,255,255)
  133.     DrawShadowTextExt(40,40,500,300,
  134.     "This PC has a non-Y2K compliant BIOS, and the year is wrong (ie 2094). You must set the correct date and year NOW, or any files you create will have an invalid creation date, and other software will behave in unpredictable ways! ",CENTER,0,0,0,1)
  135.  
  136.     UseFont("Arial",7,15,NOBOLD,NOITALIC,NOUNDERLINE,255,255,255)
  137.     DrawShadowText(300,250,"Click anywhere to continue",0,0,0,1)
  138.     
  139.     WinGetClientRect("",x1,y1,x2,y2)
  140.     SetMouse(x1,y1,x2,y2,CorrectDate,n,n)
  141.  
  142.     Return(Stringinue",0,0,0,1)
  143.     
  144.     WinGetClientRect("",x1,y1,x2,y2)
  145.     SetMouse(x1,y1,x2,y2,CorrectDate,n,n)
  146.  
  147.     Return